home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 050 / cursor.pas < prev    next >
Pascal/Delphi Source File  |  1986-01-15  |  2KB  |  59 lines

  1. { program   : CURSOR.PAS  }
  2. { written by: Tom Parson  }
  3. { date      : 12/03/85    }
  4. {  cursor_off will turn the cursor off
  5.    cursor_on will restore the cursor }
  6.  
  7.  
  8. {these routine were derived from an artice in PC Tech Journal
  9.  July 85 page 35 "The Disappearing Cursor"
  10.  
  11. It uses a  feature of the Video ROM BIOS.  If bit 5 of the cursor start
  12. position is set then the cursor will disappear}
  13.  
  14.  
  15. procedure cursor_off;
  16. {turn the cursor off }
  17. var
  18.     Regs : Record Case Integer Of                       (* MS-DOS only *) {!}
  19.            1: (AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags: Integer);
  20.            2: (AL,AH,BL,BH,CL,CH,DL,DH: Byte);
  21.            End;
  22. begin
  23.      with regs do
  24.      begin
  25.           ah:=1;              {Video BIOS function number}
  26.           ch:=$20;            {set so that cursor will turn off}
  27.      end;
  28.           intr($10,regs);    {call the video bios funtion}
  29. end;
  30.  
  31. procedure cursor_on;
  32. {turn the cursor on}
  33. var
  34.     Regs : Record Case Integer Of                       (* MS-DOS only *) {!}
  35.            1: (AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags: Integer);
  36.            2: (AL,AH,BL,BH,CL,CH,DL,DH: Byte);
  37.            End;
  38. begin
  39.      with regs do
  40.      begin
  41.           ah:=1;  {Video BIOS function number }
  42.  
  43.           if (MEM[0000:$410] and $30) = $30  {test for type of monitor}
  44.           then {monochrome monitor has 14 scan lines per character 0-13}
  45.           begin
  46.                ch:=12; {scan-line start}
  47.                cl:=13; {scan-line end}
  48.           end
  49.           else {color monitor has 8 scan line per character 0-7}
  50.           begin
  51.                ch:=6;  {scan-line start * Change this to change
  52.                                         * cursor size            }
  53.                cl:=7;  {scan-line end}
  54.           end;
  55.      end;
  56.      intr($10,regs);        {call the video bios funtion}
  57. end;
  58.  
  59.